<?php
// vim:set expandtab tabstop=3 shiftwidth=3 softtabstop=3 foldclose=all foldmethod=marker:
/**
 * 项目：   5anet
 * 文件：   class/calendar/ShowAction.class.php
 *
 * 显示日历事件详细
 *
 * PHP Version 5
 *
 * @package:   class.calendar
 * @author:    Mike.G Chinese Name: 黄叶 <hylinux@gmail.com>
 * @license:   http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1 
 * @copyright: www.5anet.com
 * @version:   $Id: $
 * @date:      $Date: $
 */

include_once CLASS_PATH.'main/BaseAction.class.php';

include_once CLASS_PATH.'calendar/CalendarUtil.class.php';


class ShowAction extends BaseAction {
   /**
    * 数据库的连接
    */
   private $db;

   /**
    * 构造函数
    * @param:  NULL
    * @return: NULL
    * @access: public
    */
   public function __construct() {
      $this->db = $this->getDB();
   }

   /**
    * 列出当日的消息
    * @param:  NULL
    * @return: NULL
    * @access: public
    */
   public function run() {

      $id = $this->getParameter('id');


      $smarty = $this->getSmarty();

      $content = CalendarUtil::getContent($this->db, $id);

      $smarty->assign('type_name', $content['eventtype']);
      $smarty->assign('type_user_name', $content['username']);
      $smarty->assign('type_title', $content['title']);
      $smarty->assign('crate_time', $content['createtime']);
      $smarty->assign('begin_time', $content['endtime']);
      $smarty->assign('content', $content['content']);


      $smarty->display('showcalendaraction.tmpl');


   }
}

?>
